package com.b.repository;

import com.b.domain.WatchHistory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface WatchHistoryRepository extends ElasticsearchRepository<WatchHistory, Integer> {
    List<WatchHistory> findWatchHistoriesByUserId(Integer userId);

    List<WatchHistory> findWatchHistoriesByUserIdOrderByWatchTimeDesc(Integer userId);

    Page<WatchHistory> findWatchHistoriesByUserIdOrderByWatchTimeDesc(Integer userId, Pageable pageable);
}
